package own.stu.jobgib.playown.basic;

import java.util.Locale;
import java.util.ResourceBundle;

public class ResourceBundleTest {

    public static void main(String[] args) {

        /*CurrencyNames_zh_CN zhCn = new CurrencyNames_zh_CN();
        System.out.println(zhCn.getString("CNY"));
        System.out.println(zhCn.getString("adp"));
        System.out.println(zhCn.getString("rur"));

        CurrencyNames_en_US en_us = new CurrencyNames_en_US();
        System.out.println(en_us.getString("CNY"));


        ResourceBundle bundle = CurrencyNames.getBundle("sun.util.resources.CurrencyNames", Locale.CHINA);
        System.out.println(bundle.getString("CNY"));*/

        myResource();
    }

    private static void myResource(){
        String resourcePath = "bundle/myres";
        ResourceBundle bundle = ResourceBundle.getBundle(resourcePath, Locale.CHINA);
        System.out.println(bundle.getString("aaa"));

        bundle = ResourceBundle.getBundle(resourcePath, Locale.getDefault());
        System.out.println(bundle.getString("aaa"));

        bundle = ResourceBundle.getBundle(resourcePath, Locale.US);
        System.out.println(bundle.getString("aaa"));
    }
}
